dojo.declare("DAdminRegisterPg", wm.Page, {
    start: function() {
        this.lookup1.setShowing(false);
        this.lookup2.setShowing(false);
    },
    "preferredDevice": "desktop",

    checkboxVendorChange: function(inSender, inDisplayValue, inDataValue, inSetByCode) {
        this.lookup1.setShowing(!inDataValue);
        this.lookup2.setShowing(!inDataValue);
         this.textAreaAddress.setShowing(inDataValue);
    
    },
    buttonRegistrationClick: function(inSender) {

        if (this.textActivationCode.getDataValue() == undefined || this.textActivationCode.getDataValue() == "") return false;


        if (this.emailEditor1.getDataValue() == undefined || this.emailEditor1.getDataValue() == "") return false;

        if (this.passwordEditor1.getDataValue() == undefined || this.passwordEditor1.getDataValue() == "") return false;

        if (this.nameEditor1.getDataValue() == undefined || this.nameEditor1.getDataValue() == "") return false;

        if (this.primaryPhoneEditor1.getDataValue() == undefined || this.primaryPhoneEditor1.getDataValue() == "") return false;
        if (!this.checkboxVendor.getChecked()) {
            if (this.lookup1.dataValue == undefined || this.lookup1.dataValue == "") return false;

            if (this.lookup2.dataValue == undefined || this.lookup2.dataValue == "") return false;
        }
        this.svRegisterUser.update();
    },
    lvBlocksSuccess: function(inSender, inDeprecated) {
		var item = this.lookup1.dataSet.getItem(0);
        this.lookup1.setDataValue(item);
	},
	lvDoorSuccess: function(inSender, inDeprecated) {
		var item = this.lookup2.dataSet.getItem(0);
        this.lookup2.setDataValue(item);
	},
	svRegisterUserSuccess1: function(inSender, inDeprecated) {
		this.formPanel1.clearData();
	},
	_end: 0
});